<template>
  <my-table path="teacher/" :cols="cols" :formObj="form" :tableAttrs="tableAttrs" :rules="rules"   >
    <template v-slot:form>
      <el-form-item label="姓名" prop="name">
        <el-input v-model="form.name" placeholder="姓名" clearable></el-input>
      </el-form-item>
      <el-form-item label="用户名" prop="username" >
        <el-input v-model="form.username" placeholder="用户名" clearable></el-input>
      </el-form-item>

    </template>
  </my-table>

</template>

<script>
  import myTable from '../../components/myTable.vue';
  export default {
    components:{
      myTable
    },
    data() {
      return {

        cols:[
          {
            property:'name',
            label:'姓名',
          },
          {
            property:'username',
            label:'用户名'
          }
        ],
        tableAttrs: {
          border: true
        },
       form: {
         name: '',
         username: '',
       },
 //对话框
        rules: {
          name: [{
            // required: true,
            message: '姓名必填',
            trigger: 'blur'
          }],
          username: [{
            // required: true,
            message: '用户名必填',
            trigger: 'blur'
          }],
        },
      }
    },
  }
</script>

<style>
</style>
